\documentclass{article}

\usepackage[top=25mm,bottom=25mm,left=25mm,right=25mm]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{subfig}
%\usepackage{epstopdf}
\usepackage[framed,autolinebreaks,useliterate]{mcode}
\setlength{\parindent}{0pt}

\begin{document}

\title{ESP project - Wireless Systems}
\author{Floris van Nee \& Simon Dirlik}

\maketitle

\section{} %1
\subsection{} %1.1
The BER is 0.5625, this value is independant of the number of transmitted packets.

\subsection{} %1.2
The BER is now 0, which is expected because when $h(l)$ is perfectly known, the system can perfectly correct for it.

\subsection{} %1.3
The minimum length of the cyclic prefix is the length of the channel, which is 8.\\
The cyclic prefix is required for two reasons. Firstly, it will compensate for the length of the channel, making sure that symbols do not overlap. When the cyclic prefix is as long or longer than the channel length, ISI will not occur. Secondly, it makes sure that the effect of the channel on the symbol is circular convolution. As the channel effect can be written as:

\[
y[m] = \sum_{l=0}^{N-1}{h(l)X(m-l)}
\]

For $0 \leq m \leq N-1$. This will convolute the first symbol that is not part of the prefix with all of the prefix symbols, effectively convoluting it with the end of the symbol. This makes it a circular convolution and makes sure that it is still possible to decode the message by simply taking the FFT and multiplying it with a channel estimate. This makes it considerably easier for the receiver.

\section{} %2
\subsection{} %2.1
The BER is approximately 0.035 at -10 dB.

\subsection{} %2.2
The BER is approximately 0.0037 at -20 dB.

\section{} %3
The following matlab code creates a bluetooth signal centered at 5.5 MHz, the inline comments explain the code. The spectrum of the 802.11g signal, bluetooth signal and noise can be found in figure \ref{fig:spectrum}. This is the spectrum as seen by the receiver, thus after it has passed through the channel. This channel effect causes the decrease in power for the frequencies around 7MHz.

\begin{lstlisting}
function y=pbj(size, power)
   noise = awgn(zeros(1, size), power); % add white gaussian noise to vector of zeros
   bw=1/20; % bw=1, sampling rate = 20 MHz
   [b,a]=cheby2(11,70,bw); % create filter at center frequency 0MHz.
   filtered_noise=filter(b,a,noise);
   fc=5.5/20;  % fc=1 is equivalent to sampling rate = 20 MHz
   carrier=exp(1j*2*pi*fc*(0:size-1)); % shifts center frequency to 5.5MHz.
   y=filtered_noise.*carrier;
end
\end{lstlisting}

\begin{figure}
	\centering
		\includegraphics[width=1.00\textwidth]{spectrum.eps}
	\caption{Power spectral density of 802.11g + Bluetooth + noise}
	\label{fig:spectrum}
\end{figure}

\section{} %4
\subsection{} %4.1
The bit content of the training symbols does not really matter for the efficiency of the beamforming algorithm. Therefore, we have designed the content to have a low energy peak in the time domain (what is transmitted). For this, the bits need to be composed of different frequencies. For this, a complementary code was used. How the symbol is generated can be found in the following Matlab code.

\begin{lstlisting}
r = [1 1 1 -1];
r = [r r r -r];
r = [r r r -r];
\end{lstlisting}

The time domain plot can be found in figure \ref{fig:training}. It can be seen that it does not have large peaks.

After simulation, we found that three training symbols are enough to compensate for the interference and reduce the BER to zero. For two training symbols, the BER is approximately 0.01.

\begin{figure}[d]
	\centering
		\includegraphics[width=1.00\textwidth]{training.eps}
	\caption{Time domain plot of training symbols}
	\label{fig:training}
\end{figure}

\subsection{} %4.2
For the implementation we refer to the Matlab file beamforming.m. This file implements the generation of the signals. First, the training symbols are generated and they are added in front of the data symbols. These are mapped, modulated and then taken through two channels. Now there are two signals to which the generated PBJ interference can be added. Lastly, AWGN noise is added to the signal after which it is demodulated.

\subsection{} %4.3
For the implementation we refer to the Matlab file beamforming.m, Ryk.m and ryx.m. The files Ryk.m and ryx.m implement the two formulas given in the specification. The beamformer part of beamforming.m is as follows:

\begin{lstlisting}
yout = zeros(1, messagesize);
% apply beamformer algorithm to each subcarrier
for k=0:N-1
		ryk1 = Ryk(yk1, yk2, k, TrainingSize, N)
		ryx1 = ryx(yk1, yk2, xk, k, TrainingSize, N);
		w = ryk1 \ ryx1;
		yout(k+1:N:end) = w' * [yk1(N*TrainingSize+1+k:N:end) ; yk2(N*TrainingSize+1+k:N:end)];
end
\end{lstlisting}

It basically just implements the algorithm given in the specification. For each subcarrier it calculates the matrix ryk and vector ryx, which it multiplies to obtain the weight vector. Now, each received symbol in that subcarrier can be multiplied with this weight vector to obtain the bit after beamforming.

The BER when used with three training symbols is 0. For two training symbols it is approximately 0.01.

\section{} %5
\subsection{} %5.1
It is possible to use a bandpass filter to extract the bluetooth signal. Because the bluetooth signal is much stronger than the 802.11g signal, the bandpass filtered signal will still be 10 dB SNR which can be enough. However, with just bandpass filtering it is not possible to achieve a higher SNR than 10dB.

\subsection{} %5.2
For the solution given above only one receiver is needed. Solutions with multiple receivers always use something like beamforming.

\section{} %6
There are several important things that we learned during this assignment. Firstly, the basics of the OFDM scheme are now much better understood. The discrete wireless system can be modelled as a linear time-invariant system where there is multipath fading. This leads to inter-symbol interference. OFDM is used to make it easier for the receiver to compensate for the channel, by making it possible for the receiver to use multiplication in the frequency domain instead of convolution in the time domain. Data is transmitted in the frequency domain.

We have seen the importance of this by looking at the difference in BER with and without equalization. When the channel is perfectly known and there is no interference or noise, the BER can be reduced to zero by using an equalizer. Without equalizer, the BER is practically 0.5. We have also seen that a cyclic prefix is needed in order for this to work. When noise is added, the BER increases, depending on the dB of the noise.

Lastly, we looked at different ways to suppress interference. There are multiple ways to handle interference, one of which is beamforming. When two receivers are used and a number of training symbols are transmitted beforehand, the weight factor can be estimated so interference can be cancelled out. The more training symbols are sent, the more accurate the weight factor becomes.

Another way to cancel interference is by filtering out the desired signal. However, this can only be done when the signal that is needed has a smaller bandwidth than the interfering signal.

\end{document}
